<?php
    include("common/function.php");
    include("../config/config.php");
    check_session();
?>

<!DOCTYPE html>
<!-- saved from url=(0043)http://temporary.com/admin/index/index.html -->
<html class=" js flexbox canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths" lang="" style=""><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>后台管理</title>
        <link rel="icon" type="image/ico" href="/favicon.ico">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
   
        <!-- vendor css files -->
        <link rel="stylesheet" href="/css/bootstrap.min.css">
        <link rel="stylesheet" href="/css/font-awesome.min.css">
        <link rel="stylesheet" href="/css/jquery.dataTables.min.css">
        <link rel="stylesheet" href="/css/datatables.bootstrap.min.css">
        <link rel="stylesheet" href="/css/style.css">
        <link rel="stylesheet" href="/css/main.css">
        <link rel="stylesheet" href="/css/custom.css">
        <link rel="stylesheet" href="/css/user.css">
        <link rel="stylesheet" href="/layui/css/layui.css" media="all">
        <!-- vendor css files -->

        <script src="/js/jquery-1.8.3.min.js" type="text/javascript"></script>
        <script src="/js/jquery.SuperSlide.2.1.1.js"></script>
        <script src="/js/uaredirect.js"></script>
        <script type="text/javascript" src="/js/user.js"></script>
        <script type="text/javascript" src="/layer/layer.js"></script>
        <script type="text/javascript" src="/layui/layui.js"></script>
        <!-- project main css files -->


    <style type="text/css">.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}</style></head>
    <body id="minovate" class="appWrapper device-lg scheme-default default-scheme-color header-fixed aside-fixed rightbar-hidden">
    <div id="wrap" class="animsition fade-in" style="animation-duration: 1.5s;">




<?php  include("common/head.php") ?>       
<?php  include("common/left.php") ?>


<!--/ CONTROLS Content -->

<section id="content">
    <div class="page page-dashboard">
        <div class="pageheader">

            <!-- <h2>后台主页 <span></span></h2> -->

            <div class="page-bar">

                <ul class="page-breadcrumb">
                    <li>
                        <a href="/module/home/index.php"><i class="fa fa-home"></i> 起始页</a>
                    </li>
                </ul>

                <div class="page-toolbar">
                    <a role="button" tabindex="0" class="btn btn-lightred no-border">
                        <i class="fa fa-calendar"></i>&nbsp;&nbsp;<span><?php echo date("Y年m月d日");?></span>
                    </a>
                </div>
            </div>

        </div>
        <div style="overflow: hidden;padding:0 10px 0 10px;">
            <div class="navigation">
                <div class="navigation_btn user_1" show_class="module_1">
                    账号管理
                </div>
                <div class="navigation_btn user_2 " show_class="module_2">
                    登陆ip限制
                </div>
                <div class="navigation_btn user_3" show_class="module_3">
                    其他功能
                </div>
                <div class="user_end" show_class="other">

                </div>
            </div>
            
            <div class="layui-form navigation_module module_1">
                <!-- <table class="user_table">
                    <tr>
                        <th>用户名</th>
                        <th>用户权限</th>
                        <th>编辑</th>
                        <th>删除</th>
                    </tr>
                    
                    <?php
                        // include("config/config.php");
                        // $rs = $dbh->query("SELECT * FROM user");
                        // $result_arr = $rs->fetchAll();
                        // $rs1 = $dbh->query("SELECT * FROM user_permission");
                        // $permission = $rs1->fetchAll();
                        // $table_string="";
                        // $js_string="";
                        // foreach ($result_arr as $value) {
                        //     $qx_string="";
                        //     foreach ($permission as $val) {
                        //         if(strpos($value['qx'],$val['permission'])!==false){
                        //             $qx_string.='<div class="permission_check_div"><input type="checkbox" style="display: block;" class="qx_checkbox '.$value['user_id'].'" checked="true" value="'.$val['permission'].'">'.$val['permission_name'].'</div>';
                        //         }
                        //         else{
                        //             $qx_string.='<div class="permission_check_div"><input type="checkbox" style="display: block;" class="qx_checkbox '.$value['user_id'].'" value="'.$val['permission'].'">'.$val['permission_name'].'</div>';
                        //         }
                        //     }

                        //     if($_SESSION['username']==$value['user_id']){
                        //         $table_string.='<tr>
                        //                             <td class="user_id">'.$value['user_id'].'</td>
                        //                             <td style="min-width: 500px;" id="my_user" >'.$qx_string.'</td>
                        //                             <td><button class="table_btn" onclick="edit_div('."'my_user'".')">修改密码</button></td>
                        //                             <td></td>
                        //                         </tr>';
                        //     }
                        //     else{
                        //         $table_string.='<tr>
                        //                             <td class="user_id">'.$value['user_id'].'</td>
                        //                             <td style="min-width: 500px;" id="'.$value['user_id'].'">'.$qx_string.'</td>
                        //                             <td><button class="table_btn" onclick="change_qx('."'".$value['user_id']."'".')">修改权限</button></td>
                        //                             <td><button class="table_btn" onclick="dele('."'".$value['user_id']."'".')">删除</button></td>
                        //                         </tr>';
                        //     }
                        // }
                        // echo $table_string;
                    ?>
                </table>
                <div class="table_buttom">
                    <button onclick="edit_div('new_user')">添加新用户</button>
                </div> -->
            </div>
            <div class="navigation_module module_2">

            </div>
            <div class="navigation_module module_3">

            </div>
        </div>
        <!-- /row -->
    </section></div>

<!--/ CONTENT -->

</body>
<script type="text/javascript">
    //初始状态
    $(".administrator_").css("background-color","rgba(255, 255, 255, 0.5)");
    $(".user_1").addClass("navigation_choosed_btn");
    $(".module_1").css("display","block");
    $(".<?php echo $_SESSION['username']; ?>").attr("disabled","disabled")
</script>
<script type="text/javascript">
    $(document).ready(function(){
        //模块按钮点击
        $(".navigation_btn").click(function(){
            //所有btn恢复未选中
            $(".navigation_btn").removeClass("navigation_choosed_btn");
            //当前btn选中
            $(this).addClass("navigation_choosed_btn");
            //所有模块内容隐藏
            $(".navigation_module").css("display","none");
            //当前btn所在模块内容显现
            $("."+$(this).attr("show_class")).css("display","block");
        });
    });


    function edit_div(type){

        if(type=="new_user"){
            var form_string=''
            +'    <div class="layui-form-item">'
            +'        <label class="layui-form-label">用户名</label>'
            +'        <div class="layui-input-inline">'
            +'        <input type="txt" id="username" placeholder="用户名" autocomplete="off" class="layui-input" >'
            +'        </div>'
            +'    </div>'
            +'   <div class="layui-form-item">'
            +'       <label class="layui-form-label">密码</label>'
            +'       <div class="layui-input-inline">'
            +'       <input type="password"  id="password" placeholder="请输入密码" autocomplete="off" class="layui-input">'
            +'       </div>'
            +'   </div>'
            +'   <div class="layui-form-item">'
            +'       <label class="layui-form-label">确认密码</label>'
            +'       <div class="layui-input-inline">'
            +'       <input type="password"  id="password2" placeholder="请输入确认密码" autocomplete="off" class="layui-input">'
            +'       </div>'
            +'   </div>'
            +'    <div class="layui-form-item">'
            +'        <label class="layui-form-label">权限</label>'
            +'        <div class="layui-input-inline">'
            +'<?php foreach ($permission as $val){echo '<div class="new_check_div"><input type="checkbox" style="display: block;" class="new_qx_checkbox" value="'.$val['permission'].'">'.$val['permission_name'].'</div>';}?>'
            +'        </div>'
            +'    </div>'
            +'   <button class="layui-btn" style="margin-left:30px;" onclick="add_user()"  >确认修改</button>';
        }
        else{
            var form_string=''
            +'   <div class="layui-form-item">'
            +'       <label class="layui-form-label">密码</label>'
            +'       <div class="layui-input-inline">'
            +'       <input type="password"  id="password" placeholder="请输入密码" autocomplete="off" class="layui-input">'
            +'       </div>'
            +'   </div>'
            +'   <div class="layui-form-item">'
            +'       <label class="layui-form-label">新密码</label>'
            +'       <div class="layui-input-inline">'
            +'       <input type="password"  id="password1" placeholder="请输入新密码" autocomplete="off" class="layui-input">'
            +'       </div>'
            +'   </div>'
            +'   <div class="layui-form-item">'
            +'       <label class="layui-form-label">确认密码</label>'
            +'       <div class="layui-input-inline">'
            +'       <input type="password"  id="password2" placeholder="请输入确认密码" autocomplete="off" class="layui-input">'
            +'       </div>'
            +'   </div>'
            +'   <button class="layui-btn" style="margin-left:30px;" onclick="user_edit()"  >确认修改</button>';

        }
        
        layer.open({
            type:1,
            title: '账号设置',
            area: ['500px', '500px'],
            content: form_string
        }); 
    }
</script>
</html>